package com.net.oil.base;
/*
 * Created by lch on 2018/2/20 0020.
 * 说明：mvp，model需继承自该model
 * 作用：取消rxjava的订阅
 */

import io.reactivex.disposables.CompositeDisposable;

public class BaseModel implements IBaseModel{

    protected CompositeDisposable compositeDisposable;  //需要在子model中实例化

    /**
     * 需要在p层调用该方法
     */
    @Override
    public void unSubscribe() {
        if (compositeDisposable != null){
            compositeDisposable.clear();
        }
    }
}
